Fixed deadlock

The layoutFrame method in DTAttributedTextContentView did not release the lock before returning nil. Moving the test outside the lock fixes the deadlock.