Moved locking to prevent race conditions

When testing my application with the new -race flag in Go 1.1 I found a race condition in seelog. This pull request will prevent that by just moving the locking above the Len() call.