libc: remove open-coded strlen in _gettemp
(cherry picked from commit 6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9)