perf_hooks: fix function wrapped by performance.timerify to work correctly
Fixed #40623 (closed) (#40625 also fixes this issue but it has been stale and seems not expected to be updated.)
This issue introduced by the refactoring on #37136. The previous implementation was checking whether a function or class is called using the new operator to proxy a function call.
This PR fixed to align with the previous behavior that a function works the same as if it was called directly.