bluetooth: Handle the SocketWriteData message

This API is already present on the JS side, but it was missing from the
Extension side of things.
bluetooth: Fix wrong parameter passed to a new BluetoothSocket

The BluetoothSocketState "enum" should be directly referenced.
bluetooth: Fix trying to free a NULL value

If the AddServiceRecord call failed, result is NULL and we should not
try to free it.
Merge pull request #201 from vcgomes/bluetooth-fixes

Bluetooth fixes (forgotten commit + trivial fixes)