Feature description
You can invoke command like echo $(pm path com.termux.api 2>&1 </dev/null) in termux to get termux:api plugin apk path or get error otherwise, it should be usable to detect plugin installation even without PackageManager API (or JVM).
Background information
Termux:X11 companion package can detect if main APK is installed or not via PackageManager API. Termux:API should do that too.
There are enough people coming to discord, matrix and reddit complaining about termux-api-based commands are hanging indefinitely.
Redirecting everything to /dev/null or anonymous pipes is necessary in command echo $(pm path com.termux.api 2>&1 </dev/null), the same applies to the case if you are porting it to C.
Related to:
#138
#153
#80