Fix public key retrieval semantics
Context
This MR fixes a bug that occurs when a contract emits an operation with fees equal to its balance. When prechecking the operation, fees would be debited which would cause the contract to be removed and thus would make the retrieval of its public key fail with an exception. We now start by retrieving the public key before performing the side-effects of precheck. The new semantics is that such an operation can be safely included in a block and will delete the contract. In particular, this mimics the current semantics of the plugin's precheck making it equivalent.