NY killer freed on technicality after judge rules he was held in wrong prison