getCaretPosition() now takes text-align into account

This fixes the edge case where the fake text area inherits a `text-align: center;` style but the real text area does not.