Add autoremove function to aptpkg.py

Resolves #18369.
Ignore retcode when checking for autoremove packages
Merge pull request #18420 from terminalmage/issue18369

Add autoremove function to aptpkg.py