Implementation of Realm.cancelTransaction

It can be very useful to be able to cancel/abort a write transaction. This is a simple implementation of `Realm.cancelTransaction()`.

@bmunkholm @emanuelez 
The docs for beginTransaction must also be updated to reflect that this will also end the transaction.