[BUGFIX] Check if lock directory is writable

We should check if directory is writable. Else fopen in acquireLock
would only fail with error after waiting time. Also we do not aspect
write permission issue here.

Resolves: #57463
Releases: 6.2
Change-Id: Ia767a2355aecf1e816d4c130b151443e50e1a311
Reviewed-on: https://review.typo3.org/28988
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind