Create temp file in same directory as state file.
Create temp file in same directory as state file.

This allows the os.Rename() call to be atomic. Otherwise, power loss or
hardware failure during the rename operation could cause the state file
to be corrupted.

BranLwyd/bNotify,BranLwyd/bNotify