Use unlinkSync consistently in tests

Using unlink means that the exception may be thrown asynchronously
and we will then fail to catch it and the test will abort.