Fix build script for simulator

Only codesign unit tests when targetting a real device
Move RegisterPrekeys network call outside of TSEncryptedDatabase