don't evaluate arrays on EDT when debugging remotely

(cherry picked from commit ed2a20feeec3dad31e25d5e027940cf85f2b065f)
remove code duplicate (use isUnderRemoteDebug directly)

(cherry picked from commit 43b8a662654406422ad01743841324736c5d7214)